@import "./util.less";

.pageMain {
  margin-top: @navHeight;
  margin-left: 0;
  position: relative;
  min-height: 300px;
  padding: 20px;
  transition: margin-left .3s ease-out;
}

body.showAside {
  .pageMain {
    margin-left: @asideWidth;

    @media screen and (max-width: @mobileWidth) {
      margin-left: 0;
    }

  }
}

.formCtl {
  position: relative;
  width: 100%;
  height: 46px;
  line-height: 44px;
  margin-bottom: 30px;
  border: 1px solid @borderColor;
  border-radius: 5px;

  transition: border-color .3s, box-shadow .3s;

  &.error {
    border-color: @errorColor;
    box-shadow: 0 0 0 2px rgba(240, 65, 52, .2);

    .formTitle {
      color: @errorColor;
    }

  }

  .formErrorTip {
    position: absolute;
    width: 100%;
    left: 0;
    top: 100%;
    margin-top: 3px;
    font-size: 12px;
    line-height: 12px;
    color: @errorColor;
  }

  &.miniTitle {
    .formTitle {
      transform: translate(5px, -6px) scale(0.75);
    }
  }

  .formTitle {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(15px, 14px);

    font-size: 16px;
    height: 16px;
    line-height: 16px;

    color: #999;
    background-color: #fff;
    transition: transform .3s ease-out;
  }

  .formInput {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 5px;
  }

  .formChb {
    margin-left: 18px;
    display: inline-block;

    label {
      //padding-left: 5px;
    }

  }
}

.figure {
  min-height: 50px;
  padding: 20px;
  border-bottom: 1px solid @borderColor;
  position: relative;
  overflow: auto;
  margin-left: -20px;
  margin-right: -20px;

  canvas {
    position: relative;
    margin: 0 auto;
    display: block;
  }

}

.log {
  padding: 20px 0;
  line-height: 1.5em;
  overflow: auto;

  p {
    white-space: nowrap;
    line-height: 1.5em;
  }

  .logSelectWrap{
    position: relative;
    display: inline-block;
    border: 1px solid @borderColor;
    cursor: pointer;
    &:after{
      content: '';
      display: inline-block;
      position: absolute;
      width: 6px;
      height: 6px;
      border: 1px solid @borderColor;
      border-bottom: none;
      border-left: none;
      top: 5px;
      right: 5px;
      transform: translate(0,0) rotate(135deg);
      transition: transform .6s,border-color .6s;
    }

    &:hover{
      //border-color: @green1;
      &:after{
        border-color: @green1;
        transform: translate(0,2px) rotate(135deg);
      }
    }
  }
  .logSelect{
    background-color: transparent;
    border: none;
    line-height: 1.5em;
    height: 1.5em;
    box-sizing: content-box;
    .appearance(none);
    padding-right: 30px;
    padding-left: 5px;
    cursor: pointer;
  }

  /* ie9 hack */
  @hack:~"/9";
  @media screen and (min-width:0@hack) {
    .logSelect{
      border:1px solid @borderColor@hack;
    }
    .logSelectWrap{
      border: none@hack;
      &:after{
        display: none@hack;
      }
    }
  }

  .logInput {
    display: inline-block;
    min-width: 50px;
    min-height: 1em;
    position: relative;
    vertical-align: text-bottom;

    border: 1px solid @borderColor;
    box-sizing: content-box;

    //letter-spacing: 1px;

    .fontStyle() {
      display: inline-block;
      font-size: 14px;
      line-height: 1.5em;
      letter-spacing: 0;
    }

    .logInputHolder {
      .fontStyle();
      letter-spacing: 2px;
    }

    textarea {
      .fontStyle();

      position: absolute;
      height: 100%;
      width: 100%;
      border: none;
      top: 0;
      left: 0;
      overflow: hidden;
    }

  }

  .logOutput {
    border: 1px solid @borderColor;
    border-radius: 5px;
    min-height: 2em;
    padding: 5px;
    margin-top: 0.5em;
  }
}

.fieldset {
  border: 1px solid @borderColor;
  border-radius: 5px;
  padding: 10px 20px;
  position: relative;
  line-height: 1.5em;
  margin-bottom: 20px;

  h2 {
    color: #999;
    position: absolute;

    background-color: #fff;

    font-size: 16px;
    height: 16px;
    line-height: 16px;

    left: 0;
    top: 0;
    transform: translate(5px, -6px) scale(0.75);
  }

}

.syntax {

  .fieldset;
  padding: 20px 0;

  .clearFix();

  .syntaxInner {
    position: relative;
    width: 100%;
    overflow: hidden;
  }
  ul {
    overflow: hidden;
    width: 50%;
    float: left;

    @media screen and (max-width: @mobileWidth) {
      width: 100%;
    }

    li {

      height: 1.5em;
      line-height: 1.5em;
      display: flex;
      position: relative;
      transition: all 0.3s;

      cursor: default;

      border-left: 2px solid transparent;
      transform-origin: 0 50%;
      flex-flow: nowrap;

      &:hover {
        border-color: @green1;
        transform: scale(1.1);
      }

      .key {
        padding-left: 20px;
        width: 120px;
        flex-basis: 120px;
      }

      .desc {
        flex-grow: 1;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
      }

    }
  }

}

.note {
  .fieldset;
  color: #999;
  font-size: 12px;
  a {
    text-decoration: underline;
  }
}

a.regexLink{
  width: 18px;
  height: 18px;
  display: inline-block;
  background-color: #ddd;
  line-height: 18px;
  text-align: center;
  border-radius: 50%;
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;

  @media screen and (max-width: @mobileWidth) {
    right: 5px;
  }

}
